load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "arg_extensions",
    srcs = glob(["extensions/**/*.rs"]),
    autocargo = {"cargo_toml_dir": "extensions"},
)

rust_library(
    name = "environment",
    srcs = glob(["environment/**/*.rs"]),
    autocargo = {"cargo_toml_dir": "environment"},
    deps = [
        "fbsource//third-party/rust:clap",
        "fbsource//third-party/rust:strum",
        "fbsource//third-party/rust:tokio",
        "//common/rust/shed/cached_config:cached_config",
        "//common/rust/shed/fbinit:fbinit",
        "//eden/mononoke/blobstore:blobstore_factory",
        "//eden/mononoke/common/rendezvous:rendezvous",
        "//eden/mononoke/common/rust/sql_ext:sql_ext",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/derived_data:derived_data_remote",
        "//eden/mononoke/megarepo_api:megarepo_config",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/observability:observability",
        "//eden/mononoke/permission_checker:permission_checker",
        "//eden/mononoke/repo_attributes/bookmarks/bookmarks_cache:bookmarks_cache",
        "//eden/mononoke/repo_attributes/commit_graph/commit_graph_types:commit_graph_types",
        "//eden/scm/lib/clientinfo:clientinfo",
    ],
)

rust_library(
    name = "cmdlib_logging",
    srcs = glob(["logging/**/*.rs"]),
    autocargo = {"cargo_toml_dir": "log"},
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:clap",
        "fbsource//third-party/rust:log",
        "fbsource//third-party/rust:tracing",
        "fbsource//third-party/rust:tracing-glog",
        "fbsource//third-party/rust:tracing-log",
        "fbsource//third-party/rust:tracing-subscriber",
        "//common/rust/folly/logging:logging",
        "//common/rust/gflags:gflags",
        "//common/rust/shed/cached_config:cached_config",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/hostname:hostname",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//common/rust/shed/panichandler:panichandler",
        "//eden/mononoke/cmdlib:arg_extensions",
        "//eden/mononoke/common/scribe_ext:scribe_ext",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/observability:observability",
    ],
)

rust_library(
    name = "cmdlib_cross_repo",
    srcs = glob(["cross_repo/src/**/*.rs"]),
    autocargo = {"cargo_toml_dir": "cross_repo"},
    deps = [
        "fbsource//third-party/rust:anyhow",
        "//common/rust/shed/facet:facet",
        "//eden/mononoke/cmdlib/mononoke_app:mononoke_app",
        "//eden/mononoke/features/cross_repo_sync:cross_repo_sync",
        "//eden/mononoke/repo_attributes/sql_query_config:sql_query_config",
        "//eden/mononoke/repo_factory:repo_factory",
        "//eden/mononoke/server/context:context",
    ],
)
